﻿
namespace TrackSystem.Entities.Extensions
{
    /// <summary>
    /// 属性基类定义
    /// </summary>
    public class ParamsBase
    {
        /// <summary>
        ///  索引号
        /// </summary>
        public int Index;
        /// <summary>
        /// 属性名
        /// </summary>
        public string? Name;
        /// <summary>
        /// 属性描述
        /// </summary>
        public string? Desciption;
        /// <summary>
        /// 读写类型
        /// </summary>
        public bool ReadOnly;
        /// <summary>
        /// 数据类型 b - 逻辑类型 i-整数类型 f-浮点数类型
        /// </summary>
        public DataTypeEnum DataType;

        public ParamsBase()
        {
            Index = 1;
            Name = string.Empty;
            Desciption = string.Empty;
            ReadOnly = false;
            DataType = DataTypeEnum.DOUBLE;
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="idx">序号</param>
        /// <param name="name">变量名称</param>
        /// <param name="desciption">描述</param>
        /// <param name="rw">读写类型</param>
        /// <param name="dataType">数据类型</param>
        public ParamsBase(int idx, string name, string desciption, bool rw, DataTypeEnum dataType = DataTypeEnum.DOUBLE)
        {
            Index = idx;
            Name = name;
            Desciption = desciption;
            ReadOnly = rw;
            DataType = dataType;
        }
    }
}
